package hammersmith.local.valueobjects;

import hammersmith.local.management.ShopManagement;
import hammersmith.local.persistence.DBHandler;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * Customer-Klasse
 * 
 * @author hammersmith
 */

public class Customer extends Person implements Serializable {

	private static final long serialVersionUID = 6189888226959388834L;
	private int customerId;
	private String eMail;
	private String password;

	private ShoppingCart cart;
	private ArrayList<Invoice> invoiceList = new ArrayList<Invoice>();

	// Konstruktors
	public Customer() {
		super();
	}

	public Customer(String n, String v, String str, String plz, String ort,
			int knr, String mail, String pw) {
		super(n, v, str, plz, ort);
		this.customerId = knr;
		this.eMail = mail;
		this.password = pw;
		this.cart = new ShoppingCart();
	}

	public ShoppingCart getCart() {
		if(cart==null){
			this.cart=new ShoppingCart();
			return this.cart;
		} else {
			return this.cart;
		}
	}
	
	public void setCart(ShoppingCart cart) {
		this.cart = cart;
	}

	public ArrayList<Invoice> getBillList() {
		return invoiceList;
	}

	public int getCustomerId() {
		return customerId;
	}

	public String getEMail() {
		return eMail;
	}
		public ArrayList<Invoice> getInvoiceList() {
		return invoiceList;	
	}

	public String getPassword() {
		return password;
	}

	
	public void setCustomerId(int customerId) {
		this.customerId = customerId;
	}

	public void seteMail(String eMail) {
		this.eMail = eMail;
	}

	public void setEMail(String eMail) {
		this.eMail = eMail;
	}

	public void setInvoiceList(ArrayList<Invoice> invoiceList) {
		this.invoiceList = invoiceList;
	}

	public void setPassword(String password) {
		this.password = password;
	}

}
